<template>
    <el-dialog
            title="审批流程"
            :visible.sync="dialogVisible"
            width="50%"
    >
        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="模块">
                <el-select v-model="form.approveModuleId" placeholder="请选择模块">
                    <el-option
                            v-for="item in moduleList"
                            :label="item.moduleName"
                            :key="item.id"
                            :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="初审">
                <el-select v-model="form.firstApprover" placeholder="初审人">
                    <el-option
                            v-for="item in userList"
                            :key="item.id"
                            :label="item.username"
                            :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="复审">
                <el-select v-model="form.secondApprover" placeholder="复审人">
                    <el-option
                            v-for="item in userList"
                            :key="item.id"
                            :label="item.username"
                            :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
            <el-form-item label="终审">
                <el-select v-model="form.thirdApprover" placeholder="终审人">
                    <el-option
                            v-for="item in userList"
                            :key="item.id"
                            :label="item.username"
                            :value="item.id">
                    </el-option>
                </el-select>
            </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
            <el-button @click="dialogVisible = false">取 消</el-button>
            <el-button type="primary" @click="submitForm">确 定</el-button>
          </span>
    </el-dialog>
</template>

<script>
    export default {
        name: "process-dialog",
        props:['data','userList','moduleList'],
        computed: {
            form() {
                return this.data;
            }
        },
        data(){
           return {
               dialogVisible:false
           }
        },
        methods: {
            open() {
                this.dialogVisible = true;
            },
            close(){
                this.dialogVisible = false;
            },
            submitForm(){
                this.$emit('confirm',this.form)
            }
        },
    }
</script>

<style scoped>

</style>